package com.mrjy.video.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.VideoGrade;
import com.mrjy.video.bo.IVideoGradeBo;

@Controller
@RequestMapping("/video/videoGrade")
public class VideoGradeController {
	@Resource
	private IVideoGradeBo videoGradeBo;
	
	@RequestMapping("/insert")
	@ResponseBody
	public Object insert(VideoGrade videoGrade,HttpSession session) {
		videoGradeBo.txInsert(videoGrade,session);
		return "ok";
	}
	
	@RequestMapping("/deleteByIds")
	@ResponseBody
	public Object deleteByIds(int[] ids) {
		return videoGradeBo.txDeleteByIds(ids);
	}

	@RequestMapping("/updateDisableFlag")
	@ResponseBody
	public Object updateDisableFlag(VideoGrade videoGrade,HttpSession session) {
		return videoGradeBo.txUpdateDisableFlag(videoGrade,session);
	}	
		
	@RequestMapping("/updateById")
	@ResponseBody
	public Object updateById(VideoGrade videoGrade,HttpSession session) {
		videoGradeBo.txUpdateById(videoGrade,session);
		return "ok";
	}	
	
	@RequestMapping("/queryById")
	@ResponseBody
	public Object queryById(int id) {
		return videoGradeBo.queryById(id);
	}
	
	@RequestMapping("/queryPage")
	@ResponseBody
	public Object queryPage(VideoGrade videoGrade,HttpSession session) {
		return videoGradeBo.queryPage(videoGrade,session);
	}
	
	@RequestMapping("/queryList")
	@ResponseBody
	public Object queryList(VideoGrade videoGrade) {
		return videoGradeBo.queryList(videoGrade);
	}
	
	@RequestMapping("/updates")
	@ResponseBody
	public Object updates(int videoId, int[] gradeIds) {
		return videoGradeBo.txUpdates(videoId, gradeIds);
	}
}
